home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v9n02.arc / SUBROUTN.BAT < prev    next >
DOS Batch File  |  1990-01-02  |  592b  |  28 lines

  1. @ECHO OFF
  2. SET myvar=joker
  3. REM ---v--- Put the name of the return label in e-var "return"
  4. SET return=ret1
  5. REM ---v--- Now jump to the subroutine
  6. GOTO sub
  7. REM ---v--- When the subroutine ends, it will jump to this label
  8. :ret1
  9. SET myvar=penguin
  10. SET return=ret2
  11. GOTO sub
  12. :ret2
  13. SET myvar=riddler
  14. SET return=ret3
  15. GOTO sub
  16. :ret3
  17. ECHO That's all!
  18. GOTO end
  19. REM ---------- This is the subroutine -- when finished it jumps to
  20. REM ---------- the label whose name is stored in e-var "return"
  21.  
  22.   :sub
  23.   ECHO The current value of myvar is "%myvar%"
  24.   PAUSE
  25.   GOTO %return%
  26.  
  27. :end
  28.